Fixes error: No buffer to delete