fixed few issues and bugs